
/*

DEPENDENCIES:
-------------
Gimme.Style
-------------


IN THIS FILE:
-------------
ext.get_scroll_pos
-------------

*/

(function()
{
	Gimme.ext.get_scroll_pos = function(n)
	{
		var elem = this[n || 0];		
		var pos = { x: 0, y: 0 };		
		if (elem === window)
		{
			// window.pageYOffset is used by Firefox and Mozilla browsers, Safari, Opera, and Konqueror
			if (typeof window.pageYOffset !== 'undefined')
			{
				pos.x = window.pageXOffset;	
				pos.y = window.pageYOffset;
			}
			// document.documentElement.scrollTop is used by IE6 in standards-compliant mode
			else if (!Gimme.Browser.is_in_quirks_mode && typeof document.documentElement.scrollTop !== 'undefined')
			{
				pos.x = document.documentElement.scrollLeft;
				pos.y = document.documentElement.scrollTop;
			}
			// document.body.scrollTop is used by IE6 in "Quirks" mode
			else if (typeof document.body.scrollTop !== 'undefined')
			{
				pos.x = document.body.scrollLeft;
				pos.y = document.body.scrollTop;
			}
		}
		else
		{
			pos.x = elem.scrollLeft;
			pos.y = elem.scrollTop;
		}
		return pos;
	}
	//[AltSyntax]Gimme.ext.getScrollPosition = Gimme.ext.get_scroll_pos;
})();